UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NefUCiwc3nHRAOPYylDMj7/pk/jtVkbTH5yCawSJMow=' 
WHERE 
  key_id = '25d951e910187cbf9cc6e138fde29ebf8b44a42c85feb1d0ffafd0ad90d20f31' 
  AND (
    token = 'NefUCiwc3nHRAOPYylDMj7/pk/jtVkbTH5yCawSJMow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033