UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'InLagmI2pgLVKkR+GcuWVSMSuZfaJ+Uz/5oARKeQ4mY='
WHERE
key_id = '8157b595ca451debfc0d1dcf6ed976825000d5d9404b4195345220badb8f51e0'
AND (
token = 'InLagmI2pgLVKkR+GcuWVSMSuZfaJ+Uz/5oARKeQ4mY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)