UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vBZ1SsNdVIBrxowKEq3tujPF9kzccCI8RceuwfhrU10='
WHERE
key_id = '5c67d98e187be1a37eb5ef42f76ef0677ca8c2a3fa31acee6b1329a17b506337'
AND (
token = 'vBZ1SsNdVIBrxowKEq3tujPF9kzccCI8RceuwfhrU10='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)