UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E29XyjE7RRKctPjNDOuNyXqGSf31BZ4Pr2qf0xl4Tss='
WHERE
key_id = '3b03ce4ba94d43b56b171cf259e79d6c36db7e71239754465ce2df18925da88e'
AND (
token = 'E29XyjE7RRKctPjNDOuNyXqGSf31BZ4Pr2qf0xl4Tss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)