UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '585LcfujKxE8TcqqfMGbELsdgtxSCHdcYyxpf/kCJ98='
WHERE
key_id = '55759e6db6e923693cd0a2704dcd4b3c9a0f414b78a6b68e37549ea3b7a2c6fc'
AND (
token = '585LcfujKxE8TcqqfMGbELsdgtxSCHdcYyxpf/kCJ98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)