UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SZLjpFYa+cxB6Uuuic9Dy42o/OlAYVC191tHP6jjUto=' 
WHERE 
  key_id = 'ddc4b088dbd0aa7ba02953dbf7ac6cd057d3574622387fd7a9579397175be003' 
  AND (
    token = 'SZLjpFYa+cxB6Uuuic9Dy42o/OlAYVC191tHP6jjUto=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036