UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lWeJDojnAYiqVFgZWsNRChbko7wdaJ/x66DTQxDcDH4='
WHERE
key_id = '5c5b683537bc8a7213283d8731bf4c4abecb76e2c9ab5023ad681f42a746b7e9'
AND (
token = 'lWeJDojnAYiqVFgZWsNRChbko7wdaJ/x66DTQxDcDH4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)