UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8galMiL8d0FLDeOTnkf8nMmxCn7kMGLH8TmTE03rJEs=' 
WHERE 
  key_id = '3f48bc4e58dd125ecedade0ec6eb2731bfc39e7873f0ade140b4d97d31721dff' 
  AND (
    token = '8galMiL8d0FLDeOTnkf8nMmxCn7kMGLH8TmTE03rJEs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028