UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pOebMCUP8LAGHlH3sUfT82uXLXjJothfMvamELIgRNk=' 
WHERE 
  key_id = '4405d0bb67e40894a3377dcf2c5f8e7b22f8ca2e13567ea16d101e4d8dadba11' 
  AND (
    token = 'pOebMCUP8LAGHlH3sUfT82uXLXjJothfMvamELIgRNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018