UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XUEClqlYRvU6F3T5LgYa8ZtnT89XW0Gx43OIl7RrtOE=' 
WHERE 
  key_id = 'ecedaa410aebb77f2dd7bac0ef6c7e50c95ee19f8e81567048c8add4b4a69ac2' 
  AND (
    token = 'XUEClqlYRvU6F3T5LgYa8ZtnT89XW0Gx43OIl7RrtOE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025