UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eym1uBm8R1h5xkG7HBDMcb7Ex8gAsWXgh8pjprU4rmA=' 
WHERE 
  key_id = '063fde14582205b8684a9f0ab777bf5d1390c23892b97f9696cdcb160f738bfe' 
  AND (
    token = 'eym1uBm8R1h5xkG7HBDMcb7Ex8gAsWXgh8pjprU4rmA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046