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