UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GRifWZy8F4oR/5CKCMilM+6bmpv0jTH0xGN2DIRP1BE='
WHERE
key_id = '06e9a2a8692091c20f284e463e5324d9f31065c07ffb9f1d7f4b702dc5f90680'
AND (
token = 'GRifWZy8F4oR/5CKCMilM+6bmpv0jTH0xGN2DIRP1BE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)