UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZVXzUIZZc5t88n90mtyZJCtkUaGqkKshGl7Ny+V9nAA=' 
WHERE 
  key_id = 'dbe3e39fcd5f7ac58f9af97c0cb52aa2c89c4120d0a80a798d214509c8cc2215' 
  AND (
    token = 'ZVXzUIZZc5t88n90mtyZJCtkUaGqkKshGl7Ny+V9nAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017