UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'taFL+/TzplVB1HydRhB7rOJ44WbAfynPO8anLXoy/EU=' 
WHERE 
  key_id = 'a102eb9cd318a7936610dd0a7d448e6b9df7d40e39fe80c2037e4380af62c88b' 
  AND (
    token = 'taFL+/TzplVB1HydRhB7rOJ44WbAfynPO8anLXoy/EU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016