UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3cbvMvAhfT1jTCcLQED0MKFUoS0WjkSmlLAWLS/1zSk=' 
WHERE 
  key_id = '8d3e6820c728ea7c580b94feca5689f89b4cbf7b94eb25bec59d5759bbccf5fe' 
  AND (
    token = '3cbvMvAhfT1jTCcLQED0MKFUoS0WjkSmlLAWLS/1zSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030