UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9wNlJFa30ifF8W7u0k1lpm0T78r4wdi8fdgLzTDhIpE=' 
WHERE 
  key_id = 'e6c030189451f53fa42680ca6809325977144e5eb3b4a331f938bb7a5b8812d8' 
  AND (
    token = '9wNlJFa30ifF8W7u0k1lpm0T78r4wdi8fdgLzTDhIpE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057