UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ERbsfiysp/K0oEZ94/wJdrqoxrr2QKixJP7nq8pQUTo='
WHERE
key_id = '82f4f5666baddf1fbc4a9673d935c9172e363651a6a49f5494e914fad410d274'
AND (
token = 'ERbsfiysp/K0oEZ94/wJdrqoxrr2QKixJP7nq8pQUTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)