UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bcRTxAvsB3ImmcCRglf1Sg4b4xoesjnNqlS+Sg10jhI='
WHERE
key_id = '89b1ae18c23e242b1f1d8043b631ae542c219d780a3b90250bd54d0f4b4c9cf1'
AND (
token = 'bcRTxAvsB3ImmcCRglf1Sg4b4xoesjnNqlS+Sg10jhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)