UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9mmENUvqdNldgO4Kmp2bxeg5FZ/5f5I5PRSiCeiEiyw='
WHERE
key_id = '4438d0c317055b5f3ac0c2f156265b3240b241467d096e8f730bb16eae5f5e6c'
AND (
token = '9mmENUvqdNldgO4Kmp2bxeg5FZ/5f5I5PRSiCeiEiyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)