UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6KS2/4F338rINiOCtOOqZMjXM4QYfAaPhH4tnDlkL5I=' 
WHERE 
  key_id = '56d8f924b56e495a6b7cdf5fb404da0684ea59afe8f0912536c05796f4f08f35' 
  AND (
    token = '6KS2/4F338rINiOCtOOqZMjXM4QYfAaPhH4tnDlkL5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018