UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+K62RAx0oVB4RwRX0/qRwdB36qCOMjK6FHLkyLhaU2w='
WHERE
key_id = '3514bd1fda16fc330960db3bbb5d12e9ab41a512d91e08e164bdfb02d8c1afe6'
AND (
token = '+K62RAx0oVB4RwRX0/qRwdB36qCOMjK6FHLkyLhaU2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)