UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D7acqUVnOukmS+n7W7t1lNQpMWdKQqpTiw3KvE6iE6k=' 
WHERE 
  key_id = '8659e163ffc895273e050839db96f4f8d5d1513e254b67877ef5024b21119ea8' 
  AND (
    token = 'D7acqUVnOukmS+n7W7t1lNQpMWdKQqpTiw3KvE6iE6k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035