UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JlUQrVg9SKV8CeccbClagBmnHwuuMB0zGUf4K2IAxJ0=' 
WHERE 
  key_id = '2cb1853c7bcd29cea8bbbd8be0aa65a85e8e715a75cdaac74700f9ad6768b5bb' 
  AND (
    token = 'JlUQrVg9SKV8CeccbClagBmnHwuuMB0zGUf4K2IAxJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016