UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lgxZYPaebx/UN7wM5HWwc/pzP5fIfU8jTPmhncpmxKU='
WHERE
key_id = '5f8ac382643fb7181b3fcde2d5d18f4de40a040d46d9fc02397660c67450e68d'
AND (
token = 'lgxZYPaebx/UN7wM5HWwc/pzP5fIfU8jTPmhncpmxKU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)