UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kHtc//ukHUh3xoMI0ykxpRa4rXuhSP5EFQqdfuscDUM='
WHERE
key_id = 'da723d2cdcbb05bf3a5e97e73e9ba5f77365c6e9c960a5cedcdc4c3da28513f5'
AND (
token = 'kHtc//ukHUh3xoMI0ykxpRa4rXuhSP5EFQqdfuscDUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)