UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NKNPp3e42LmvHxe51Zn+DS4tYs9LR5V4+6Gb7pqwfbY=' 
WHERE 
  key_id = '2e25d4b2455feba61395e531da3180df87c75cc2b0cac067e34aacdb2b5302bf' 
  AND (
    token = 'NKNPp3e42LmvHxe51Zn+DS4tYs9LR5V4+6Gb7pqwfbY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029