UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Ue+dx8soRXVnMB9TaYhczv7w5hgEa+iZe0QuuMyoC0='
WHERE
key_id = '5892abc4ab383d876ef5713bd5f9b2d56432ab9996e1302322108b0820e5af57'
AND (
token = '3Ue+dx8soRXVnMB9TaYhczv7w5hgEa+iZe0QuuMyoC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)