UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HmOg1PoNbBnf4sOP7t7hOfMajDQQDavJSOxCTh8XX3w='
WHERE
key_id = '3574eb9115f746e1c403b37655ff218f482510359ef4ca24e29d40fb9893d695'
AND (
token = 'HmOg1PoNbBnf4sOP7t7hOfMajDQQDavJSOxCTh8XX3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)