UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0+z0OkH5xSigeEkyuQl3k+lyjmWSUh8PTI4Ine9KVQY=' 
WHERE 
  key_id = 'cb90c4344340c203cca0884d81f9f40617e831ff12b80006b776f5571aa35fe2' 
  AND (
    token = '0+z0OkH5xSigeEkyuQl3k+lyjmWSUh8PTI4Ine9KVQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057