UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bszkMcfQSArBabFFx8XoFqme1PftlTAwws2rbpKPIUk=' 
WHERE 
  key_id = 'be41b051e63f37cf062b7ded47eef4f90804c1f75dee1f7f79884363c13c0961' 
  AND (
    token = 'bszkMcfQSArBabFFx8XoFqme1PftlTAwws2rbpKPIUk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019