UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uhJ11mU1ity/nksIekOfK4jeDTlPKmhTL2XUj+xZXUk=' 
WHERE 
  key_id = '919859cec2c619577d52c5322570a0467b28749fcc068d347713a8fd0ba4c76e' 
  AND (
    token = 'uhJ11mU1ity/nksIekOfK4jeDTlPKmhTL2XUj+xZXUk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022