UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fGvpvjV08sjztGA9YCAmB0/ig6JrqbCMu485Q6QKXbc='
WHERE
key_id = 'aad0542889a705fce85b362242fe13ae0d30e5a966157375698551881e92c429'
AND (
token = 'fGvpvjV08sjztGA9YCAmB0/ig6JrqbCMu485Q6QKXbc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)