UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aV6rOof6l+sof9E4WrmbdHFKjvbJEieV/Oq+FpydaLo=' 
WHERE 
  key_id = '5e3c9692f5334ccc6570176edd6b9d4cf1ec69b22a2afc53d44f2e6aed258773' 
  AND (
    token = 'aV6rOof6l+sof9E4WrmbdHFKjvbJEieV/Oq+FpydaLo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063