UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fnSKj8nJp4oqSQEtiGWLRXshvQ6VOQrAoBFdR1I3DZU='
WHERE
key_id = '7c8eff1b111903053866bc63474eac1959ff2a5238f977f0f4905c345a005170'
AND (
token = 'fnSKj8nJp4oqSQEtiGWLRXshvQ6VOQrAoBFdR1I3DZU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)