UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9dnLbvZ6Skql33JKOWYmW6g2tCv6cRih3b4UKrCokoM=' 
WHERE 
  key_id = '22c697c7cf7937c3ffba07bf8658b4c8e9dcc259d30c52c1fcd2763c3b17047e' 
  AND (
    token = '9dnLbvZ6Skql33JKOWYmW6g2tCv6cRih3b4UKrCokoM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066