UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HnQ/XNsZWUGNK20W1wzY2d4M6oz45wccdp8Trmf2RJ8='
WHERE
key_id = '7ba32728433427dc7c831ca6929a0a720a042e4cf4283e8bb75d7f34ca44f929'
AND (
token = 'HnQ/XNsZWUGNK20W1wzY2d4M6oz45wccdp8Trmf2RJ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)