UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QYVcji5td8U5FvfSeGjWGOs86DadxEX5YzpbaPVHFzA='
WHERE
key_id = '2a5817f5351bc1fd747df02a2efa1f20c51c7ac6d844b27b728628fa1274c85f'
AND (
token = 'QYVcji5td8U5FvfSeGjWGOs86DadxEX5YzpbaPVHFzA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)