UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qyx+69DLpo/KFvE+6xjCJPuiHe5uxqlCmpmwPI/CgG0='
WHERE
key_id = '6fb7ff2ba55c3a727ffcc7168ef2d8d697bb015500aaa85250633ea6e015d1de'
AND (
token = 'Qyx+69DLpo/KFvE+6xjCJPuiHe5uxqlCmpmwPI/CgG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)