UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'paS6z7zhPCSQR9ziqvk2SCV/rxR1FQminZNNcChy+HU=' 
WHERE 
  key_id = '1a1d900c71af8be3092ba935e591df05c8309a47cab2d5cc3bb45449a06d1578' 
  AND (
    token = 'paS6z7zhPCSQR9ziqvk2SCV/rxR1FQminZNNcChy+HU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022