UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pNHPNqHFCoeNug3Y2LPwPgl7dnztutpDsmW2nW6owmg='
WHERE
key_id = '92136283b529f5c281717f4f796120e033784e63f609a7b46f1e76bad0804e70'
AND (
token = 'pNHPNqHFCoeNug3Y2LPwPgl7dnztutpDsmW2nW6owmg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)