UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2CowYp+79i2HGrYxCiRmH1olVyB3dgvGnGyfxBWQICk='
WHERE
key_id = '376bb6411faa7a31527bfe545fe1fc293cf276aee207cf2318e86650ceec90c7'
AND (
token = '2CowYp+79i2HGrYxCiRmH1olVyB3dgvGnGyfxBWQICk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)