UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lHF1y3q+WBiB5LGhpas61M4wQxm5pMEqpzzjMtq6cIY='
WHERE
key_id = '70ed8fa95ed75fbf6219793053e58a6e9fd607faa31467109a8cd880ca4d94dd'
AND (
token = 'lHF1y3q+WBiB5LGhpas61M4wQxm5pMEqpzzjMtq6cIY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)