UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sm6/QKjBC69MHmTtoGPKjnKU92SDzDTvp3s0GTPBzLQ='
WHERE
key_id = 'bd8391986297c4e996fd76f0d6bc28cb9f1c6621fe1e114b06bd0bc1a4e0cdec'
AND (
token = 'Sm6/QKjBC69MHmTtoGPKjnKU92SDzDTvp3s0GTPBzLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)