UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2BuH8EC311Yx4k6UHyToBeT5Z2d3BMk5kq4CpbYgPm4='
WHERE
key_id = '94f2d48fc48fc3ebd5e631f2f533d79b0befb26516e96e0d24e8991da20e2395'
AND (
token = '2BuH8EC311Yx4k6UHyToBeT5Z2d3BMk5kq4CpbYgPm4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)