UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EcWqdW7jZuTG2D4uzXjyyckxQdQRRv2Kb+YrzfhDrqY='
WHERE
key_id = '25ee782022a6ea06314035a0129e04c5b4a0be2eff78a290ff512d83e922675a'
AND (
token = 'EcWqdW7jZuTG2D4uzXjyyckxQdQRRv2Kb+YrzfhDrqY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)