UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qCm+roT7IqbQ9JKi0oCu1TKtby8RFCwyRTOYJmpGXgs='
WHERE
key_id = 'b3a2f1f20110a9fb3b30bf16668e83a295e5b4305fcf169a99eaa29d2920f7f2'
AND (
token = 'qCm+roT7IqbQ9JKi0oCu1TKtby8RFCwyRTOYJmpGXgs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)