UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '73uLCfk+/fsIKNP/1Lfpak7nsX2u8Q//d9LnJ/4lKYc='
WHERE
key_id = '1c9d8f97aabf55e2f9301e2aee782a2539178b1c3381b959a637952e175aae36'
AND (
token = '73uLCfk+/fsIKNP/1Lfpak7nsX2u8Q//d9LnJ/4lKYc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)