UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GK4EVMXnr4jqTq+mjarrRvS7MWILkRnvnDC/WPf1THY=' 
WHERE 
  key_id = '59e96ce5739cba082a2a2b3bba4615eb6c6128f5a45077f15102958bba9cb9e6' 
  AND (
    token = 'GK4EVMXnr4jqTq+mjarrRvS7MWILkRnvnDC/WPf1THY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027