UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qUCBQgz9mEq+kJ2M5MhdzzHVIAdyel/V2IHCzu8MK8g='
WHERE
key_id = '1967e9652b03613433f0bc6913977a75eb6e568a75a3e54d2da63a8689b2300f'
AND (
token = 'qUCBQgz9mEq+kJ2M5MhdzzHVIAdyel/V2IHCzu8MK8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)