UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WBF/6Vdo4R2pKRwTH7qL5HV7FQ/v/kXkexqBVgJZ1Qc='
WHERE
key_id = '9daf540cc3c72ab5359c956294af8bbb44c03b20e73a7d1d434d3eabc34b16c1'
AND (
token = 'WBF/6Vdo4R2pKRwTH7qL5HV7FQ/v/kXkexqBVgJZ1Qc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)