UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OcatCsfurktlJiuwTO08+YqRk0IgmenHM7Vbz8/YMMo=' 
WHERE 
  key_id = '307e54f20e488fd88fdd064b846e7e1d500790d9a73b8ecf432847256b9c3d3c' 
  AND (
    token = 'OcatCsfurktlJiuwTO08+YqRk0IgmenHM7Vbz8/YMMo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053