UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xx7d0fwNOECJnof2In9HuA3cCecdBpKrRiqhqsR/yac=' 
WHERE 
  key_id = 'ab6296edbfbe0c42ebd2241ad1487ca5812d3efeeb13f9cd3de800e6789357cd' 
  AND (
    token = 'Xx7d0fwNOECJnof2In9HuA3cCecdBpKrRiqhqsR/yac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029