UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MDQX0WYljNa9N1QoMkOl7QfouZfoAAA89dK80IgJ1Ok='
WHERE
key_id = 'aec6af852967107d3f4b138302cc4f51a2c731004ef7e87871541b1607543b38'
AND (
token = 'MDQX0WYljNa9N1QoMkOl7QfouZfoAAA89dK80IgJ1Ok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)