UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R6GQEPQELExBqwLUl/YcSLd5pAYVt4PaEb8lq56xpFY='
WHERE
key_id = 'a6282440e1e5083c3612bf7eb14124b2b0337f87d5d70af2d11935a365c4297c'
AND (
token = 'R6GQEPQELExBqwLUl/YcSLd5pAYVt4PaEb8lq56xpFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)