UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ub55Cf4/lknMQ3ApBwLdns4hswxIMRldVzLTpkF6E/0='
WHERE
key_id = 'c56ec5c82f2b98e9584f52807a166415de02562ede9cfa64832697eed1d0cfd7'
AND (
token = 'Ub55Cf4/lknMQ3ApBwLdns4hswxIMRldVzLTpkF6E/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)