UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wvlJ9BKsvAKxN31GKqupFNlvONmULLS44ae7xkrFLcg=' 
WHERE 
  key_id = '34260132232ed8fec192312d35a3b67891db6e6e5b03804769e4c4425d67cf6c' 
  AND (
    token = 'wvlJ9BKsvAKxN31GKqupFNlvONmULLS44ae7xkrFLcg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039