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

Query time 0.00019