UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wpr6Y9DwORsVaGXFOZHprkcSOFRHavGR+mVJGZDdg/I='
WHERE
key_id = '66f0dcdd3e6312f01356e27895ef7a27c6a6565f78f5a85ea59a100d324cb5f1'
AND (
token = 'wpr6Y9DwORsVaGXFOZHprkcSOFRHavGR+mVJGZDdg/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)