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

Query time 0.00036