UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TrXdP4AwCDQtQTyyzpJRJrC/yIRO8f0wAD58l45iRWQ='
WHERE
key_id = '087fb566c225dcd8d921aa71321a85a55ddff801e9ff8eda9117cfce6da70f49'
AND (
token = 'TrXdP4AwCDQtQTyyzpJRJrC/yIRO8f0wAD58l45iRWQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)