UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xTityGk9Lgs9oo5lhhu+pvJkwC9G78xHe8PEnMVzFRs=' 
WHERE 
  key_id = '294dd4554cce58fbff866d26ac29fd09cbae39ce5c6ad352d72a8a861ac214ee' 
  AND (
    token = 'xTityGk9Lgs9oo5lhhu+pvJkwC9G78xHe8PEnMVzFRs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050