UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NiiRPJcLHymR5D3zjkqpcm/SRWh3SpS9WRjA9fXmvss='
WHERE
key_id = 'bc4c8f1e1ee5d9e4fd388a5af0a3c01c8154f014dae43cd4157c4ca31f683e4f'
AND (
token = 'NiiRPJcLHymR5D3zjkqpcm/SRWh3SpS9WRjA9fXmvss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)